package com.dev.security.controller;

import com.dev.security.service.LogService;
import com.dev.security.vo.LogVo;
import com.dev.security.vo.PageVo;
import com.dev.security.vo.ResponseData;
import com.dev.security.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * #Author:槐序二四
 * #Time：2020/4/16 19:10
 * #Motto:人间荒唐市侩 不如山中作怪🌙.
 */
@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    @GetMapping("/list")
    public ResponseEntity list(LogVo logVo, PageVo pageVo){
        ResponseData<List<LogVo>> result = new ResponseData();
        PageVo<LogVo> pageVo1 = logService.selectList(logVo,pageVo);
        result.setCount(pageVo1.getTotal());
        result.setData(pageVo1.getList());
        return ResponseEntity.ok(result);
    }
}
